from multiprocessing import Process
import time


def func(name: str):
    print(f"{name} - step - 1\n", end="")
    time.sleep(1)
    print(f"{name} - step - 2\n", end="")
    return f"{name} - done"


def main():
    process = [Process(target=func, args=(n,)) for n in ["A", "B", "C"]]

    for p in process:
        p.start()  # 用于启动进程
    for p in process:
        p.join()  # 用于等待进程结束
    print("主进程结束")


if __name__ == '__main__':
    main()
